home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16_Src.lha / Python16_Source / Include / modsupport.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-03  |  3.1 KB  |  99 lines

  1. #ifndef Py_MODSUPPORT_H
  2. #define Py_MODSUPPORT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6.  
  7. /* Module support interface */
  8.  
  9. #ifdef HAVE_STDARG_PROTOTYPES
  10.  
  11. #include <stdarg.h>
  12.  
  13. extern DL_IMPORT(int) PyArg_Parse Py_PROTO((PyObject *, char *, ...));
  14. extern DL_IMPORT(int) PyArg_ParseTuple Py_PROTO((PyObject *, char *, ...));
  15. extern DL_IMPORT(int) PyArg_ParseTupleAndKeywords Py_PROTO((PyObject *, PyObject *,
  16.                          char *, char **, ...));
  17. extern DL_IMPORT(PyObject *) Py_BuildValue Py_PROTO((char *, ...));
  18.  
  19. #else
  20.  
  21. #include <varargs.h>
  22.  
  23. /* Better to have no prototypes at all for varargs functions in this case */
  24. extern DL_IMPORT(int) PyArg_Parse();
  25. extern DL_IMPORT(int) PyArg_ParseTuple();
  26. extern DL_IMPORT(PyObject *) Py_BuildValue();
  27.  
  28. #endif
  29.  
  30. extern DL_IMPORT(int) PyArg_VaParse Py_PROTO((PyObject *, char *, va_list));
  31. extern DL_IMPORT(PyObject *) Py_VaBuildValue Py_PROTO((char *, va_list));
  32.  
  33. #define PYTHON_API_VERSION 1009
  34. #define PYTHON_API_STRING "1009"
  35. /* The API version is maintained (independently from the Python version)
  36.    so we can detect mismatches between the interpreter and dynamically
  37.    loaded modules.  These are diagnosticised by an error message but
  38.    the module is still loaded (because the mismatch can only be tested
  39.    after loading the module).  The error message is intended to
  40.    explain the core dump a few seconds later.
  41.  
  42.    The symbol PYTHON_API_STRING defines the same value as a string
  43.    literal.  *** PLEASE MAKE SURE THE DEFINITIONS MATCH. ***
  44.  
  45.    Please add a line or two to the top of this log for each API
  46.    version change:
  47.  
  48.    14-Mar-2000  GvR     1009    Unicode API added
  49.  
  50.    3-Jan-1999    GvR    1007    Decided to change back!  (Don't reuse 1008!)
  51.  
  52.    3-Dec-1998    GvR    1008    Python 1.5.2b1
  53.  
  54.    18-Jan-1997    GvR    1007    string interning and other speedups
  55.  
  56.    11-Oct-1996    GvR    renamed Py_Ellipses to Py_Ellipsis :-(
  57.  
  58.    30-Jul-1996    GvR    Slice and ellipses syntax added
  59.  
  60.    23-Jul-1996    GvR    For 1.4 -- better safe than sorry this time :-)
  61.  
  62.    7-Nov-1995    GvR    Keyword arguments (should've been done at 1.3 :-( )
  63.  
  64.    10-Jan-1995    GvR    Renamed globals to new naming scheme
  65.  
  66.    9-Jan-1995    GvR    Initial version (incompatible with older API)
  67. */
  68.  
  69. #ifdef MS_WINDOWS
  70. /* Special defines for Windows versions used to live here.  Things
  71.    have changed, and the "Version" is now in a global string variable.
  72.    Reason for this is that this for easier branding of a "custom DLL"
  73.    without actually needing a recompile.  */
  74. #endif /* MS_WINDOWS */
  75.  
  76. #ifdef Py_TRACE_REFS
  77. /* When we are tracing reference counts, rename Py_InitModule4 so
  78.    modules compiled with incompatible settings will generate a
  79.    link-time error. */
  80. #define Py_InitModule4 Py_InitModule4TraceRefs
  81. #endif
  82.  
  83. extern DL_IMPORT(PyObject *) Py_InitModule4 Py_PROTO((char *, PyMethodDef *,
  84.                       char *, PyObject *, int));
  85. #define Py_InitModule(name, methods) \
  86.     Py_InitModule4(name, methods, (char *)NULL, (PyObject *)NULL, \
  87.                PYTHON_API_VERSION)
  88.  
  89. #define Py_InitModule3(name, methods, doc) \
  90.     Py_InitModule4(name, methods, doc, (PyObject *)NULL, \
  91.                PYTHON_API_VERSION)
  92.  
  93. extern DL_IMPORT(char *) _Py_PackageContext;
  94.  
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif /* !Py_MODSUPPORT_H */
  99.